<%= title t :albums %>

<h1>Albums</h1>

<%= link_to "New", :new_album  %>

<br>

<% form_tag  do -%>
	<p>
		Search:
		<%= text_field_tag :search_field %>
	
		<%= image_tag 'spinner.gif', :id => 'spinner', :style => 'display: none' %>
	</p>
<% end -%>

<div id='results'>
	<%=	render :partial => 'result'	, :collection => @albums %>
</div>

<%= link_to "Home", :controller => :home %>

<%= observe_field 'search_field',
      :url    			=> { :action => 'albums_completion' },
      :frequency 	=> 1,
      :before 			=> "Element.show('spinner')",
      :complete 		=> [ visual_effect(:highlight, :results), "Element.hide('spinner')" ],
      :update 			=> :results,
      :with   			=> 'prefix' %>

